<template>
	<view class="main">
		<view class="setup">
			<view class="items active" @tap="toChangePass()">
				<view class="label ">设置密码</view>
				<u-icon name="arrow-right"></u-icon>
				<!-- <view class="val" @click="navTo('昵称','李元芳')">李元芳</view> -->
			</view>
			<view class="items active" @tap="toChangeMobile()">
				<view class="label">修改手机号码</view>
				<u-icon name="arrow-right"></u-icon>
				<!-- <view class="val" >李元芳<u-icon name="arrow-right"></u-icon></view> -->
			</view>
			<view class="items">
				<view class="label">微信</view>
				<u-switch v-model="wxChecked" inactive-color="#E3E3E3" size="40" active-color="#F4333C"></u-switch>
			</view>
			<view class="items">
				<view class="label">QQ</view>
				<u-switch v-model="qqChecked" inactive-color="#E3E3E3" size="40" active-color="#F4333C"></u-switch>
			</view>
			<view class="items">
				<view class="label">微博</view>
				<u-switch v-model="wbChecked" inactive-color="#E3E3E3" size="40" active-color="#F4333C"></u-switch>
			</view>
			<view class="items">
				<view class="label">检查更新</view>
				<view class="val" >当前已是最新版本<u-icon name="arrow-right"></u-icon></view>
			</view>
			<view class="items">
				<view class="label">清除缓存</view>
				<u-icon name="arrow-right"></u-icon>
				<!-- <view class="val" @click="navTo('昵称','李元芳')">李元芳<u-icon name="arrow-right"></u-icon></view> -->
			</view>
			<view class="items">
				<view class="label">关于我们</view>
				<u-icon name="arrow-right"></u-icon>
				<!-- <view class="val" @click="navTo('昵称','李元芳')">李元芳<u-icon name="arrow-right"></u-icon></view> -->
			</view>
			<view class="foot" @tap="userLogout">退出</view>
		</view>
	</view>
</template>

<script>
	import { API } from '../../../config/myApi.js';
	export default {
		data() {
			return {
				show: false,
				wxChecked:false,
				qqChecked:true,
				wbChecked:true
			};
		},
		methods: {
			navTo(label,val){
			    let url = '/pages/tabbar/user/personalCenter/perEdit'
			    let param = {
			        label: label,
			        val: val
			    }
			    this.$navTo.navTos(url,param)
			},
			userLogout() {
				uni.clearStorageSync();
				API.userLogout().then(res => {
					uni.navigateTo({
						url: "/pages/login/login"
					})
				})
			},
			toChangePass(){
				uni.navigateTo({
					url:"/pages/mine/changPassword/changPassword"
				})
			},
			toChangeMobile(){
				uni.navigateTo({
					url:"/pages/mine/setMobile/setMobile"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '../ascss/setup.scss';
	.active:active{
		background-color: #e1e1e1 !important;
	}
</style>
